{extend name="public/base" /}
{block name="css"}
<style>
    div.qorl{width:80px;height:auto;border-radius:5px;padding:0 5px;text-align:center;color:white;}
    div.qd{background:#ffb752;}
    div.ly{background:#87b87f;}
</style>

{/block}

{block name="theme"}其他管理{/block}
{block name="small_theme"}来源管理{/block}
{block name="content"}
<div class="col-xs-12">
    <!-- PAGE CONTENT BEGINS -->
    <div class="row">
        <div class="col-xs-12">
            <h3 class="header blue lighter smaller">
                <i class="ace-icon fa fa-list-alt smaller-90"></i>
                新增来源
                <a href="javascript:showlayer('{:url('add')}');"><i class="ace-icon fa fa-plus smaller-90 middle" data-icon-hide="ace-icon fa fa-minus" data-icon-show="ace-icon fa fa-plus"></i></a>
            </h3>
            <table id="sample-table-1" class="table table-striped table-bordered table-hover">
                <thead>
                <tr>
                    <th class="center">
                        <label class="position-relative">
                            <input type="checkbox" class="ace" />
                            <span class="lbl"></span>
                        </label>
                    </th>
                    <th>ID</th>
                    <th>来源(来源/学校名)</th>
                    <th>学校名称</th>
                    <th>地区</th>
                    <th>地址</th>
                    <!--<th>线下来源类别</th>-->
                    <th>类别</th>
                    <th>状态</th>
                    <th>操作</th>
                </tr>
                </thead>

                <tbody>
                {volist name="origin" id='vo'}
                <tr>
                    <td class="center">
                        <label class="position-relative">
                            <input type="checkbox" class="ace" />
                            <span class="lbl"></span>
                        </label>
                    </td>

                    <td>{$vo.id}</td>
                    <td>{$vo.title}</td>
                    <td>{$vo.school}</td>
                    <td>{$vo.area.name}</td>
                    <td>{$vo.address}</td>
                    <!--<td>{$vo.qdtype.title}</td>-->
                    <td>
                        {if condition="$vo.type == 1"}<div class="btn btn-xs btn-warning">线上来源</div>{else/}<div class="btn btn-xs btn-success">线下来源</div>{/if}
                    </td>
                    <td>{$vo.status_text}</td>
                    <td>
                        <div class="hidden-sm hidden-xs btn-group">
                            <a class="btn btn-xs btn-danger" href="javascript:showlayer('{:url('edit',['id'=>$vo['id']])}'); " title="编辑">
                                <i class="ace-icon fa fa-edit bigger-120"></i>
                                编辑
                            </a>
                            <a class="btn btn-xs btn-warning" href="javascript:opendel2('{:url('del',['id'=>$vo['id']])}');" title="删除">
                                <i class="ace-icon fa fa-trash-o bigger-120"></i>
                                删除
                            </a>
                            <!--<a class="btn btn-xs btn-info" href="javascript:setstates('{:url('set_states',['id'=>$vo['id']])}');" title="状态授权">-->
                                <!--<i class="ace-icon fa fa-flag bigger-120"></i>-->
                                <!--绑定班级-->
                            <!--</a>-->
                        </div>
                        <div class="hidden-md hidden-lg">
                            <div class="inline position-relative">
                                <button class="btn btn-minier btn-primary dropdown-toggle" data-toggle="dropdown" data-position="auto">
                                    <i class="ace-icon fa fa-cog icon-only bigger-110"></i>
                                </button>
                                <ul class="dropdown-menu dropdown-only-icon dropdown-yellow dropdown-menu-right dropdown-caret dropdown-close">
                                    <li>
                                        <a href="{:url('edit',['id'=>$vo['id']])}" class="tooltip-success" data-rel="tooltip" title="编辑">
                                                <span class="green">
                                                    <i class="ace-icon fa fa-pencil-square-o bigger-120"></i>
                                                </span>
                                        </a>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </td>
                </tr>
                {/volist}
                </tbody>
            </table>
        </div><!-- /.span -->
    </div><!-- /.row -->
</div><!-- /.col -->
{/block}
{block name="js"}
<script>
    //    function opendel(url){
    //        layer.confirm('确定删除？', {
    //            skin: 'layui-layer-lan', //样式类名
    //            btn: ['真的',' 假的'] //按钮
    //        }, function(index){
    //            layer.close(index);
    ////            $.post(url,"{:url('index')}");
    //
    //        }, function(){
    //            layer.msg('扔下我的時候请想想我的好', {
    //                icon: 2,
    //            });
    //        });
    //    }
    highlight_subnav("{:url('index')}");
    var setStatusUrl = "{:url('setStatus')}";
    function setstates(url){
        layer.open({
            type: 2,
            anim:6,
            title: '设置状态',
            skin: 'layui-layer-lan', //样式类名
            shadeClose: true,
            shade: 0.8,
            area: ['50%', '80%'],
            content: url,
            end:function(){
            }
        });
    }
</script>
{/block}